<!-- html -->
<template>
  <el-row>
    <el-col :span="24">
      <el-button type="primary" @click="toHome" style="float: left">首页</el-button>
      <el-button type="primary" @click="toMenu" style="float: left">菜单</el-button>
      <el-button type="danger" @click="toHome" style="float: right">退出</el-button>
    </el-col>
    <el-col :span="24">
      <RouterView />
    </el-col>
  </el-row>
</template>

<!-- js或ts -->
<script lang="ts">
export default {
  name: 'app'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
import { useRouter } from 'vue-router'

//数据
let router = useRouter()
//方法
function toHome() {
  router.push({
    path: '/home'
  })
}
function toMenu() {
  router.push({
    path: '/menu'
  })
}
</script>

<!-- 样式 -->
<style scoped></style>